package cn.fl.riskctrl.xjdb.transform;

import java.util.ArrayList;
import java.util.List;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.riskctrl.xjdb.vo.XjnpEndmInsPaymVO;
import fl.riskctrl.facade.xjdb.dto.XjnpEndmInsPaymDTO;

 /**
 * @Description: 个人信用报告_养老保险金发放记录(TP_ENDOWMENTINSURANCEDELIVER) 转换器
 * @Description: VO是客户端传递数据到服务端进行转换的数据 
 * @Description: VO转换数据变成DTO传递到服务端 
 * @Description: VO不能在服务端出现
 */
public class XjnpEndmInsPaymVOTransform {


	/**
	 * DTO 转  VO
	 * @param po XjnpEndmInsPaymDTO
	 * @return XjnpEndmInsPaymVO
	 */
	public static XjnpEndmInsPaymVO toVO(XjnpEndmInsPaymDTO dto) {
		XjnpEndmInsPaymVO  vo = null;
		if (dto != null) { 
			vo = new XjnpEndmInsPaymVO();
			vo.setId(dto.getId());
			vo.setArea(dto.getArea());//发放地
			vo.setGettime(dto.getGettime());//信息更新日期
			vo.setMoney(dto.getMoney());//本月实发养老金
			vo.setOrganname(dto.getOrganname());//原单位名称
			vo.setPausereason(dto.getPausereason());//停发原因
			vo.setRetiretype(dto.getRetiretype());//离退休月份
			vo.setRetireddate(dto.getRetireddate());//离退休类别
			vo.setWorkdate(dto.getWorkdate());//参加工作月份
			vo.setReportNo(dto.getReportNo());//报告编号-关联报告表ID

			vo.setCrtTm(dto.getCrtTm());//创建时间
			vo.setCrtUsrId(dto.getCrtUsrId());//创建人
			vo.setMdfTm(dto.getMdfTm());//修改时间
			vo.setMdfUsrId(dto.getMdfUsrId());//修改人
		}
		return vo;
	}

	/**
	 * VO 转 DTO
	 * @param dto XjnpEndmInsPaymVO
	 * @return XjnpEndmInsPaymDTO
	 */
	public static XjnpEndmInsPaymDTO toDTO(XjnpEndmInsPaymVO vo) {
		XjnpEndmInsPaymDTO dto = null;
		if (vo != null) {
			dto = new XjnpEndmInsPaymDTO();
			dto.setId(vo.getId());
			dto.setArea(vo.getArea());//发放地
			dto.setGettime(vo.getGettime());//信息更新日期
			dto.setMoney(vo.getMoney());//本月实发养老金
			dto.setOrganname(vo.getOrganname());//原单位名称
			dto.setPausereason(vo.getPausereason());//停发原因
			dto.setRetiretype(vo.getRetiretype());//离退休月份
			dto.setRetireddate(vo.getRetireddate());//离退休类别
			dto.setWorkdate(vo.getWorkdate());//参加工作月份
			dto.setReportNo(vo.getReportNo());//报告编号-关联报告表ID

			dto.setCrtTm(vo.getCrtTm());//创建时间
			dto.setCrtUsrId(vo.getCrtUsrId());//创建人
			dto.setMdfTm(vo.getMdfTm());//修改时间
			dto.setMdfUsrId(vo.getMdfUsrId());//修改人
		}
		return dto;
	}
	
	/**
	 * DTO集合 转 VO集合
	 * @param List<XjnpEndmInsPaymDTO>
	 * @return List<XjnpEndmInsPaymVO>
	 */
	public static List<XjnpEndmInsPaymVO> toVOList(List<XjnpEndmInsPaymDTO> list) {
		List<XjnpEndmInsPaymVO>  voList = new ArrayList<XjnpEndmInsPaymVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (XjnpEndmInsPaymDTO dto : list) {
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
	
	/**
	 * VO集合 转 DTO集合
	 * @param list List<XjnpEndmInsPaymVO>
	 * @return List<XjnpEndmInsPaymDTO>
	 */
	public static List<XjnpEndmInsPaymDTO> toDTOList(List<XjnpEndmInsPaymVO> list) {
		List<XjnpEndmInsPaymDTO>  dtoList = new ArrayList<XjnpEndmInsPaymDTO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (XjnpEndmInsPaymVO vo : list) {
				dtoList.add(toDTO(vo));
			}
		}
		return dtoList;
	}
}
